<?php
require_once('class_managed_table.php');

class VersionedManagedTable extends ManagedTable
{
  public function __construct($mysqlTable, $mysqlPrimaryKey,
      $mysqlDatabase = null)
  {
    if ($mysqlPrimaryKey == 'id') {
      throw new InvalidArgumentException('Versioned tables use the \'id\' ' .
        'column internally, specify an alternate primary key');
    }
    parent::__construct($mysqlTable, $mysqlPrimaryKey, $mysqlDatabase);
    $this->addConstraint('current = 1');
  }
}

?>